package mr.ali.videoapp.portal.controller;


import com.github.pagehelper.PageInfo;
import mr.ali.videoapp.portal.model.CollectionPlayWatch;
import mr.ali.videoapp.portal.model.CollectionWatch;
import mr.ali.videoapp.portal.service.ICollectionPlayWatchService;
import mr.ali.videoapp.portal.service.ICollectionWatchService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mr-ali
 * @since 2025-07-20
 */
@RestController
@RequestMapping("/portal/collectionPlayWatch")
public class CollectionPlayWatchController {

    @Resource
    private ICollectionPlayWatchService collectionPlayWatchService;

    @GetMapping("/all")
    public PageInfo<CollectionPlayWatch> findAllIndex(Integer pageNum , Integer pageSize , Integer userId){
        return  collectionPlayWatchService.findAllIndex(pageNum, pageSize, userId);
    }

    @GetMapping("/delete")
    public Integer delete(Integer userId, Integer videoId){
        return collectionPlayWatchService.delete(userId, videoId);
    }
    @GetMapping("/update")
    public void update(Integer userId, Integer urlId, Integer videoId , Integer Episode ){
        collectionPlayWatchService.update(userId, urlId , videoId , Episode);
    }
}
